export default {
    namespaced: true,
  
    state() {
      const addressStr = uni.getStorageSync('address')
      let address = {}
      if (addressStr) {
        address = JSON.parse(addressStr)
      }else{
        address:{}
      }
  
      return {
        token: '',
        address,
      }
    },
  
    getters: {
      fullAddress(state) {
        const { provinceName, cityName, countyName, detailInfo } = state.address
        if (!provinceName) return ''
        return provinceName + cityName + countyName + detailInfo
      },
    },
  
    mutations: {
      setAddress(state, address) {
        state.address = address
        uni.setStorageSync('address', JSON.stringify(state.address))
      },
    },
  
    actions: {},
  }